/**
 * Created by KY on 2017/7/20.
 */
define(['ldfw/core','draggabilly'],function(LDFW,Draggabilly){
    return LDFW.Container.extend({
        el:'.side-bar',
        tpl:`<a href="#index" ><span class="icon iconfont icon-home"></span>回到首页</a>`,

        initialize:function(){
            var dragge = new Draggabilly(this.el,{
                containment:'.container'
            })
            this.dragge = dragge
        },
        rendered:function(){
            this.$el.show()
        },
        show:function(){
            if(this.el.style.display=='none'){
                this.el.style.display='block'
            }
            this.dragge.enable()

        },
        hide:function(){
            if(this.el.style.display!=='none'){
                this.el.style.display='none'
            }
            this.dragge.disable()
        }
    })
})